You can declare war and peace with other teams. The greatest use of this is that you can use planets belonging to teams you are at peace with for fuel and repair. It also allows two teams to gang up on another without risking killing each other.
There are three states a player can be in versus any other team: Peace, Hostile, and War. Being at War is irrevocable. You cannot change to any other state until you reenter the game. You get to war when you are hostile to a team and you either bomb one of their planets, damage one of their players with weapons, or beam armies down to one of their planets.
If you are hostile towards a team, your weapons will hurt all members of that team (whether or not they are at peace with you). As soon as you hurt them, you will be at war.
If you are peaceful towards a team, your weapons will only hurt members of that team who are not peaceful towards you. In other words, two players who are at peace towards each other cannot fight each other.
Players default to being at peace with their own team and hostile towards all the others. Obviously, they can declare war on their own team.
To change your settings, type 'w' and a war window will pop up. Click the mouse in the boxes of the teams you want to change. Click in "re-program" to save the results. Teams will be notified of your changes. Finally, there is a ten second delay to declare hostility towards another team so don't get too close while you make the changes.
The easiest way to know if someone near you is hostile is to use the alert status described below. Info on a player will tell you their status towards you.